package com.ourygo.fileselect.util;

import java.io.*;
import java.util.*;
import com.ourygo.fileselect.bean.*;

public class ListSort {

	public static void listSort(List<Files> filePathArrayList){
        ArrayList<Files> folderList = new ArrayList<Files>();
        ArrayList<Files> fileList = new ArrayList<Files>();
        for(Files fs : filePathArrayList){
            if(fs.isDirectory()){
                folderList.add(fs);
            }else{
                fileList.add(fs);
            }
        }

        Collections.sort(folderList);
        Collections.sort(fileList);

        filePathArrayList.clear();
        for(Files string : folderList){
            filePathArrayList.add(string);
        }
        for(Files string : fileList){
            filePathArrayList.add(string);
        }
    }

}

